#pragma once

#include "NFServerComm/NFServerCommon/NFIDescStore.h"
#include "NFServerComm/NFServerCommon/NFIDescTemplate.h"
#include "NFLogicCommon/NFDescStoreMacrosDefine.h"
#include "NFLogicCommon/NFDescStoreTypeDefines.h"
#include "E_NpcBase.nanopb.h"
#ifndef MAX_NPCBASE_NPCBASEDESC_NUM
#define MAX_NPCBASE_NPCBASEDESC_NUM 488
#endif

class FunctionNpcDesc : public NFI_DESC_TEMPLATE_MACRO(FunctionNpcDesc, E_FunctionNpc, EOT_CONST_NPCBASE_NPCBASEDESC_DESC_ID, MAX_NPCBASE_NPCBASEDESC_NUM)
public:
	FunctionNpcDesc();
	virtual ~FunctionNpcDesc();
	int CreateInit();
	int ResumeInit();
public:
	int Load(NFResDb *pDB) override;
	int LoadDB(NFResDb *pDB) override;
	int CheckWhenAllDataLoaded() override;
	std::vector<const E_FunctionNpc*> GetDescByGroupId(int64_t groupId) const;
private:
	NFShmHashMultiMap<int64_t, uint64_t, MAX_NPCBASE_NPCBASEDESC_NUM> m_groupIdIndexMap;
};
